#include <am.h>
#include <klib.h>
#include <klib-macros.h>

#define IP_BASE_ADDR 0x10004000
#define REG_CTRL *((volatile uint32_t *)(IP_BASE_ADDR))
#define REG_SEED *((volatile uint32_t *)(IP_BASE_ADDR + 4))
#define REG_VAL *((volatile uint32_t *)(IP_BASE_ADDR + 8))

int main(){
    putstr("Hello World!\n");
    REG_CTRL = (uint32_t)1;
    REG_SEED = (uint32_t)0xFE1C;
    for(int i = 0; i < 5; ++i) {
        printf("[normal]random val: %x\n", REG_VAL);
    }

    REG_SEED = (uint32_t)0;
    for(int i = 0; i < 3; ++i) {
        printf("[reset]random val: %x\n", REG_VAL);
    }
    return 0;
}
